/*
  Copyright (c) 2011, Mikheev Rostislav
  Copyright (c) 2011, FreshFarsh team

  Steel Engine source code is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
/**
  @file window.h
  @author Mikheev Rostislav <hacenator@gmail.com>
  @date 27.03.2011
  @brief GUI window class header file
    Window is basic interface element
*/

#ifndef STEEL_GUI_WINDOW_H_
#define STEEL_GUI_WINDOW_H_

#include <gl/glew.h>

#include "common.h"
#include "gui/control.h"


namespace _STEEL_NAMESPACE {

class GUIWindow : public GUIControl {
 public:
	GUIWindow(const char* name, int x, int y, int width, int height, GUISkin* skin);
	~GUIWindow() {};

  void Draw() {};

	void Mouse(int action, float x, float y) {};
	void Keyboard(int state, int key) {};

 protected:
	void DoResize() {};
	void DeleteBuffers() {};
	void DrawControl() {};

 private:
  const int vertex_count = 16;
  const int index_count = 54;
	//GUIControl * _move_over_control;
	//GUIControl * _mouse_down_control;

	GUIControl * _control_focused; ///<
	GUIControl * _control_mouse_over; ///<
	GUIControl * _control_mouse_down; ///<

	GLuint _texture_handle; ///< windows texture
	GLuint _index_buffer, _vertex_buffer, _texture_coordinate_buffer; ///< vertex object buffers

	//int _index_count;
	GLfloat _vertex_array[vertex_count][3]; //
	GLfloat _texture_array[vertex_count][2];
	GLushort _index_array[index_count];

	//int corner_offset[2]; ///< edge corners size
};

}

#endif // STEEL_GUI_WINDOW_H_
